const {Model, DataTypes} = require('sequelize');
const sequelize = require('../config/db');

class Type extends Model {}

Type.init({
    id: {
      type: DataTypes.INTEGER,
      primaryKey: true,
      autoIncrement: true,
    },
    name: {
      type: DataTypes.STRING,
      allowNull: false,
    },
    cover: {
        type: DataTypes.STRING,
        allowNull: false,
    }
}, {
  sequelize,
  modelName: 'type',
  tableName: 'types',
  timestamps: false,
});

// 移除这里的关联定义
module.exports = Type
